home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks '96 / Booting Gallery / Booting Gallery (source) / (Libraries) / Fluent Libraries / Heaps / HeapBuffer.h < prev    next >
Encoding:
Text File  |  1996-06-22  |  681 b   |  37 lines  |  [TEXT/BROW]

  1. // HeapBuffer.h
  2. // Created by Bill Hubauer on Fri, Jun 2, 1995 @ 6:44 AM.
  3.  
  4. #ifndef __HeapBuffer__
  5. #define __HeapBuffer__
  6.  
  7. #ifndef __MHeapObject__
  8. #include "MHeapObject.h"
  9. #endif
  10.  
  11.  
  12. class CHeapBuffer : public MHeapObject
  13. {
  14. public:
  15.     CHeapBuffer(CHeap&    heapSource,Size theSize);
  16.     virtual ~CHeapBuffer();
  17.     
  18.     Boolean        BufferOK()            {return _buffer != NULL;}
  19.     
  20.     Size        GetSize()            {return _size;}
  21.     Ptr            GetBuffer()            {return _buffer;}
  22.     
  23.     void        SetSize(Size newSize)    {_size = newSize;}    // you should only set
  24.                                                         // it smaller than the
  25.                                                         // original
  26.     
  27.     operator    Ptr()                {return _buffer;}
  28.     
  29. protected:
  30.         
  31.     Size        _size;
  32.     Ptr            _buffer;
  33.     CHeap&        _heapSource;
  34. };
  35.  
  36. #endif
  37.